<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>11.对象属性的添加删除操作</title>
</head>

<body>
  <script>
    // 增加属性
    let hd = { };
    hd.name = "后盾人";
    hd['age'] = 18;
    console.log(hd); //{name: "后盾人", age: 18}
    // 删除属性
    delete hd.name;
    console.log(hd); //{age: 18}
    // 当前对象是否包含属性 （非原型链）
    console.log(hd.hasOwnProperty('age')); //true
  </script>
</body>

</html>